﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.Caching;
using System.Web.UI.WebControls;
using System.Collections;

public partial class clearCache : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ClearCache();
    }

    public void ClearCache()
    {
        try
        {
            Cache cache = HttpRuntime.Cache;
            List<string> keys = new List<string>();
            foreach (DictionaryEntry entry in cache)
            {
                keys.Add((string)entry.Key);
            }
            foreach (string key in keys)
            {
                cache.Remove(key);
            }
            Response.Write("Clear cache thành công");
        }
        catch (Exception)
        {
            Response.Write("Clear cache thất bại");
        }
    }

}